// 侧边工具栏添加滚动事件
let topitem=document.querySelectorAll(".home-tool-bar .item")[5];
window.addEventListener("scroll",function(){
    let st=document.documentElement.scrollTop || document.body.scrollTop;
    if(st>1000){
       topitem.style.display='block';
    }else{
       topitem.style.display='none';

    }

})
// 点击回到顶部
topitem.addEventListener("click",function(){
    document.documentElement.scrollTop=0;

})
// 分类导航
let mlist = document.getElementById("menu_list").getElementsByTagName("li");
let mproduct=document.querySelectorAll(".list_product");
console.log(mproduct)
for(let i=0;i<mlist.length;i++){
    mlist[i].addEventListener('mouseenter',function(){
            for(let j=0;j<mproduct.length;j++){
            mproduct[j].style.display='none';
            }
            mproduct[i].style.display='block';
    })
    mlist[i].addEventListener('mouseleave',function(){
            mproduct[i].style.display='none';
            console.log("......"+mlist[i]);
    })
    mproduct[i].addEventListener('mouseenter',function(){
                    mproduct[i].style.display='block';
    })
    mproduct[i].addEventListener('mouseleave',function(){
                    mproduct[i].style.display='none';
    })
}